home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / text / edit / envwrd41.lha / envWRD41 / Install < prev    next >
Text File  |  1996-11-22  |  20KB  |  683 lines

  1. ; $VER: Words 4
  2. ; Installer script ©1996 Dietmar Eilert
  3.  
  4. (delopts "oknodelete" "force" "askuser")
  5. (complete 0)
  6.  
  7. (onerror (
  8.  
  9.     (if (> @ioerr 0) 
  10.  
  11.         " Some error has occurred. Please inform a GoldED \n"
  12.         " support site (e.g. dietmar@tomate.tng.oche.de)  \n"
  13.         " AFTER having tried a different Installer release\n"
  14.         " (1.24 is known to work fine).                   \n"
  15.     )
  16. ))
  17.  
  18. (if (exists "GOLDED:" (NOREQ))
  19.  
  20.     (
  21.         (set vernum (getversion "golded:golded"))
  22.  
  23.         (set ver (/ vernum 65536))
  24.         (set rev (- vernum (* ver 65536)))
  25.  
  26.         (set version (+ (* 10 ver) rev))
  27.  
  28.         (if (< version 44)
  29.  
  30.             (
  31.                 (message "\nSorry, GoldED 4.4.0 or better required")
  32.                 (exit (quiet))
  33.             )
  34.         )
  35.  
  36.         (if (not (exists "libs/ixemul.library"))
  37.  
  38.             (if (not (exists "libs:ixemul.library"))
  39.  
  40.                 (
  41.                     (message "\nSorry, libs:ixemul.library required (AmiNet).")
  42.  
  43.                     (exit (quiet))
  44.                 )
  45.             )
  46.         )
  47.  
  48.         (complete 5)
  49.  
  50.         (message (cat "\n"
  51.  
  52.             "Words · Spellchecking for GoldED            \n"
  53.             "                                            \n"
  54.             "©1996 Heinz Knutzen, Martin Schulz, Loren J.\n"
  55.             "      Rittle, Jesper Skov, Dietmar Eilert.  \n"
  56.             "                                            \n"
  57.             "      Commercial distribution not permitted.\n"
  58.             "      All files are the property of their   \n"
  59.             "      authors unless stated otherwise.      \n"
  60.             "                                            \n"
  61.             "Requirements:                               \n"
  62.             "                                            \n"
  63.             "GoldED 4.3.0+, ixemul.library, 5 MB RAM     \n"
  64.         ))
  65.  
  66.         (welcome)
  67.  
  68.         (complete 10)
  69.  
  70.         (set action (askoptions
  71.  
  72.             (prompt "\nSelect parts to be installed\n")
  73.  
  74.             (help @askoptions-help)
  75.  
  76.             (default 5)
  77.  
  78.             (choices
  79.  
  80.                 "Install binaries"
  81.                 "Install dictionary: German"
  82.                 "Install dictionary: English"
  83.             )
  84.         ))
  85.  
  86.         (complete 15)
  87.  
  88.         ; install binaries
  89.  
  90.         (if (in action 0) (
  91.  
  92.             ; install registry editor (if not yet installed)
  93.  
  94.             (if (not (exists "golded:tools"))
  95.  
  96.                 (makedir "golded:tools")
  97.             )
  98.  
  99.             (if (not (exists "golded:tools/regedit"))
  100.  
  101.                 (makedir "golded:tools/regedit")
  102.             )
  103.  
  104.             (copylib
  105.  
  106.                 (prompt "Install registry editor ?")
  107.                 (source "bin/regedit" )
  108.                 (dest   "golded:tools/regedit")
  109.                 (confirm)
  110.                 (help @copylib-help)
  111.             )
  112.  
  113.             ; install syntax parser
  114.  
  115.             (copylib
  116.  
  117.                 (prompt "Install syntax parser ?")
  118.                 (source "syntax/warpSPELL.parser")
  119.                 (dest   "golded:syntax")
  120.                 (confirm)
  121.                 (help @copylib-help)
  122.             )
  123.  
  124.             (if (exists "libs/ixemul.library")
  125.  
  126.                 ; install ixemul.library (required by ISpell)
  127.  
  128.                 (copylib
  129.  
  130.                     (prompt "Install ixemul.library ?")
  131.                     (source "libs/ixemul.library")
  132.                     (dest "libs:")
  133.                     (help @copylib-help)
  134.                     (confirm)
  135.                 )
  136.             )
  137.  
  138.             ; install ISpell
  139.  
  140.             (if (exists "ispell:" (quiet))
  141.  
  142.                 (set target (pathonly (expandpath "ispell:")))
  143.                 (set target "sys:")
  144.             )
  145.  
  146.             (set target (askdir
  147.  
  148.                 (prompt
  149.  
  150.                     (cat "\n"
  151.  
  152.                         "Select path for ISpell installation. The drawer \n"
  153.                         "'ISpell' is created in the directory you select:\n"
  154.                     )
  155.                 )
  156.  
  157.                 (help "A new drawer is created in the path you specify.")
  158.  
  159.                 (default target)
  160.             ))
  161.  
  162.             ; $HOME is required by ISpell; the GETENV command is broken, so we have to use EXISTS
  163.  
  164.             (if (not (exists "env:home" (NOREQ)))
  165.  
  166.                 (run "echo >envarc:HOME sys:")
  167.                 (run "echo >env:HOME    sys:")
  168.             )
  169.  
  170.             (complete 20)
  171.  
  172.             (set target (tackon target "ispell"))
  173.  
  174.             (if (not (exists target))
  175.  
  176.                 (makedir target)
  177.             )
  178.  
  179.             (makeassign "ispell" target)
  180.  
  181.             (if (not (exists "ispell:bin"))
  182.  
  183.                 (makedir "ispell:bin")
  184.             )
  185.  
  186.             (if (not (exists "ispell:doc"))
  187.  
  188.                 (makedir "ispell:doc")
  189.             )
  190.  
  191.             (if (not (exists "ispell:lib"))
  192.  
  193.                 (makedir "ispell:lib")
  194.             )
  195.  
  196.             (working "Installing ISpell...")
  197.  
  198.             (copyfiles
  199.  
  200.                 (source "ispell-3.1.18bin/bin")
  201.                 (dest   "ispell:bin")
  202.                 (all)
  203.                 (nogauge)
  204.             )
  205.  
  206.             (copyfiles
  207.  
  208.                 (source "ispell-3.1.18bin/doc")
  209.                 (dest   "ispell:doc")
  210.                 (all)
  211.                 (nogauge)
  212.             )
  213.  
  214.             (startup "WORDS"
  215.  
  216.                 (prompt "Add ISpell: assign to your user-startup ?")
  217.  
  218.                 (help @startup-help)
  219.  
  220.                 (command ("ASSIGN >NIL: ispell: %s\nPATH ISPELL:BIN ADD" target))
  221.             )
  222.  
  223.             (complete 25)
  224.  
  225.             ; install API client
  226.  
  227.             (copylib
  228.  
  229.                 (prompt "Install API client ?")
  230.                 (source "api/words.api")
  231.                 (dest   "golded:api")
  232.                 (confirm)
  233.                 (help @copylib-help)
  234.             )
  235.  
  236.             (if (not (exists "golded:tools/words"))
  237.  
  238.                 (makedir "golded:tools/words")
  239.             )
  240.  
  241.             ; install support files
  242.  
  243.             (copyfiles
  244.  
  245.                 (source "words")
  246.                 (dest   "golded:tools/words")
  247.                 (all)
  248.                 (nogauge)
  249.             )
  250.  
  251.             (copyfiles
  252.  
  253.                 (source  "")
  254.                 (dest    "golded:tools/words")
  255.                 (pattern "#?.readme")
  256.                 (nogauge)
  257.             )
  258.  
  259.             ; install toolbar images
  260.  
  261.             (if (exists "toolbar") (
  262.  
  263.                 (set hicolor
  264.  
  265.                     (askchoice
  266.  
  267.                         (prompt "\nSelect toolbar style:\n")
  268.  
  269.                         (choices
  270.  
  271.                             "4  colors"
  272.                             "8+ colors"
  273.                         )
  274.  
  275.                         (default 1)
  276.  
  277.                         (help (cat "\n"
  278.  
  279.                             " You can use both styles on all screens. The 4\n"
  280.                             " color style has been optimized for 4-color   \n"
  281.                             " screens. The 8+ style has been optimized for \n"
  282.                             " screens with eight or more colors.           \n"
  283.                         ))
  284.                     )
  285.                 )
  286.  
  287.                 (if (not (exists "golded:toolbar"))
  288.  
  289.                     (makedir "golded:toolbar")
  290.                 )
  291.  
  292.                 (if (not (exists "golded:toolbar/words"))
  293.  
  294.                     (makedir "golded:toolbar/words")
  295.                 )
  296.  
  297.                 (copyfiles
  298.  
  299.                     (source "toolbar")
  300.                     (dest   "golded:toolbar")
  301.                     (all)
  302.                     (nogauge)
  303.                 )
  304.  
  305.                 (if (= hicolor 1)
  306.  
  307.                     (copyfiles
  308.  
  309.                         (source "toolbar16")
  310.                         (dest   "golded:toolbar")
  311.                         (nogauge)
  312.                         (all)
  313.                     )
  314.                 )
  315.             ))
  316.  
  317.             (complete 30)
  318.  
  319.         ))
  320.  
  321.         ; install German dictionary
  322.  
  323.         (complete 35)
  324.  
  325.         (if (in action 1) (
  326.  
  327.             ; set default ISpell options
  328.  
  329.             (copyfiles
  330.  
  331.                 (source "env/d")
  332.                 (dest "env:")
  333.                 (all)
  334.                 (nogauge)
  335.             )
  336.  
  337.             (copyfiles
  338.  
  339.                 (source "env/d")
  340.                 (dest "envarc:")
  341.                 (all)
  342.                 (nogauge)
  343.             )
  344.  
  345.             (set partsA (askoptions
  346.  
  347.                 (prompt "Select German dictionaries to be installed (1/2)")
  348.  
  349.                 (help (cat "\n"
  350.  
  351.                     " The more dictionaries you select, the more \n"
  352.                     " memory ISpell will use. File sized listed  \n"
  353.                     " are NOT RAM requirements - RAM requirements\n"
  354.                     " are about three times higher.              \n"
  355.                 ))
  356.  
  357.                 (choices
  358.  
  359.                     "Substantive        (250 K)"
  360.                     "Verben             (120 K)"
  361.                     "Adjektive & Co     ( 10 K)"
  362.                     "Zusammensetzungen  (550 K)"
  363.                     "Geographie         ( 15 K)"
  364.                     "Namen              (  5 K)"
  365.                     "Abkuerzungen       (  1 K)"
  366.                     "Imperative         (  1 K)"
  367.                     "Latein             (  1 K)"
  368.                 )
  369.  
  370.                 (default 503)
  371.             ))
  372.  
  373.             (complete 40)
  374.  
  375.             (set partsB (askoptions
  376.  
  377.                 (prompt "Select German dictionaries to be installed (2/2)")
  378.  
  379.                 (help (cat "\n"
  380.  
  381.                     " The more dictionaries you select, the more \n"
  382.                     " memory ISpell will use. File sized listed  \n"
  383.                     " are NOT RAM requirements - RAM requirements\n"
  384.                     " are about three times higher.              \n"
  385.                 ))
  386.  
  387.                 (choices
  388.  
  389.                     "Informatik, EDV    ( 25 K)"
  390.                     "Elektronik         ( 10 K)"
  391.                     "Organisationen     (  1 K)"
  392.                     "Marken             (  1 K)"
  393.                     "Griechisch         (  1 K)"
  394.                     "Roemische Zahlen   (  1 K)"
  395.                     "Technik            (  2 K)"
  396.                     "Seltenes           ( 10 K)"
  397.                 )
  398.  
  399.                 (default 12)
  400.             ))
  401.  
  402.             (complete 45)
  403.  
  404.             (if (or (<> partsA 0) (<> partsB 0)) (
  405.  
  406.                 (working "\nCreating dictionary, sorting entries. May take some minutes.\n")
  407.  
  408.                 (delete "dictionary/deutsch/words/all.words.cnt")
  409.                 (delete "dictionary/deutsch/words/all.words.stat")
  410.  
  411.                 (set cmd "bin/joinsorted >con://///AUTO DIR=dictionary/deutsch/words as=dictionary/deutsch/words/all.words ")
  412.  
  413.                 (if (in partsA 0) (set cmd (cat cmd "worte.txt "      )))
  414.                 (if (in partsA 1) (set cmd (cat cmd "verben.txt "     )))
  415.                 (if (in partsA 2) (set cmd (cat cmd "klein.txt "      )))
  416.                 (if (in partsA 2) (set cmd (cat cmd "adjektive.txt "  )))
  417.                 (if (in partsA 3) (set cmd (cat cmd "zusammen.txt "   )))
  418.                 (if (in partsA 4) (set cmd (cat cmd "geographie.txt " )))
  419.                 (if (in partsA 4) (set cmd (cat cmd "geogra2.txt "    )))
  420.                 (if (in partsA 5) (set cmd (cat cmd "namen.txt "      )))
  421.                 (if (in partsA 5) (set cmd (cat cmd "vornamen.txt "   )))
  422.                 (if (in partsA 5) (set cmd (cat cmd "vornam2.txt "    )))
  423.                 (if (in partsA 6) (set cmd (cat cmd "abkuerz.txt "    )))
  424.                 (if (in partsA 6) (set cmd (cat cmd "abkuerz2.txt "   )))
  425.                 (if (in partsA 7) (set cmd (cat cmd "imperat.txt "    )))
  426.                 (if (in partsA 8) (set cmd (cat cmd "latein.txt "     )))
  427.  
  428.                 (if (in partsB 0) (set cmd (cat cmd "compeng.txt "    )))
  429.                 (if (in partsB 0) (set cmd (cat cmd "infoabk.txt "    )))
  430.                 (if (in partsB 0) (set cmd (cat cmd "informatik.txt " )))
  431.                 (if (in partsB 1) (set cmd (cat cmd "elektronik.txt " )))
  432.                 (if (in partsB 2) (set cmd (cat cmd "orgabk.txt "     )))
  433.                 (if (in partsB 3) (set cmd (cat cmd "marken.txt "     )))
  434.                 (if (in partsB 4) (set cmd (cat cmd "alphabeta.txt "  )))
  435.                 (if (in partsB 5) (set cmd (cat cmd "roemisch.txt "   )))
  436.                 (if (in partsB 6) (set cmd (cat cmd "technik.txt "    )))
  437.                 (if (in partsB 7) (set cmd (cat cmd "seltenes.txt "   )))
  438.  
  439.                 (run cmd)
  440.  
  441.                 (if (exists "dictionary/deutsch/words/all.words" (noreq))
  442.  
  443.                     (
  444.                         (working "\nChecking dictionary. May take some minutes.\n")
  445.  
  446.                         (run "bin/ifilter >con://///AUTO FILE=dictionary/deutsch/words/all.words NOTEX")
  447.  
  448.                         (complete 50)
  449.  
  450.                         (if (exists "ispell:lib/deutsch.hash")
  451.  
  452.                             (set remove (askbool
  453.  
  454.                                 (prompt "\nOverwrite old hash file (ispell:lib/deutsch.hash) ?")
  455.  
  456.                                 (help "You might want to backup your old file :-)")
  457.  
  458.                                 (choices
  459.  
  460.                                     "overwrite"
  461.                                     "exit"
  462.                                 )
  463.                             ))
  464.  
  465.                             (set remove 1);
  466.                         )
  467.  
  468.                         (if (= remove 1)
  469.  
  470.                             (
  471.                                 (delete "ispell:lib/deutsch.hash")
  472.  
  473.                                 (working "\nCreating hash file supporting fast data access. May take some minutes and LOTS of RAM.\n")
  474.  
  475.                                 (complete 55)
  476.  
  477.                                 (run "ispell:bin/buildhash >NIL: -s dictionary/deutsch/words/all.words dictionary/deutsch/words/deutsch.aff ispell:lib/deutsch.hash")
  478.  
  479.                                 (complete 60)
  480.  
  481.                                 (if (exists "ispell:lib/deutsch.hash")
  482.  
  483.                                     (
  484.                                         (copyfiles
  485.  
  486.                                             (source "dictionary/deutsch/words/deutsch.aff")
  487.                                             (dest "ispell:lib")
  488.                                             (nogauge)
  489.                                         )
  490.  
  491.                                         (message (cat "\nHash file 'ispell:lib/deutsch.hash' has been created successfully. Hash file size (ISpell RAM usage):\n\n" (getsize "ispell:lib/deutsch.hash") " Bytes"))
  492.                                     )
  493.  
  494.                                     (
  495.  
  496.                                         (message "\nFatal error: hash file creation failed (out of RAM ?).\n")
  497.  
  498.                                         (delete "language/deutsch/words/all.words")
  499.  
  500.                                         (exit (quiet))
  501.                                     )
  502.                                 )
  503.                             )
  504.                         )
  505.  
  506.                         (complete 65)
  507.  
  508.                         (delete "dictionary/deutsch/words/all.words")
  509.                     )
  510.  
  511.                     (
  512.                         (message "\nFatal error - dictionary creation failed.")
  513.  
  514.                         (exit (quiet))
  515.                     )
  516.                 )
  517.             ))
  518.         ))
  519.  
  520.         ; install English dictionary
  521.  
  522.         (complete 70)
  523.  
  524.         (if (in action 2) (
  525.  
  526.             ; set default ISpell options
  527.  
  528.             (copyfiles
  529.  
  530.                 (source "env/e")
  531.                 (dest "env:")
  532.                 (all)
  533.                 (nogauge)
  534.             )
  535.  
  536.             (copyfiles
  537.  
  538.                 (source "env/e")
  539.                 (dest "envarc:")
  540.                 (all)
  541.                 (nogauge)
  542.             )
  543.  
  544.             (set partsA (askchoice
  545.  
  546.                 (prompt "\nSelect English dictionaries to install\n")
  547.  
  548.                 (help (cat "\n"
  549.  
  550.                     " The more dictionaries you select, the more \n"
  551.                     " memory ISpell will use. File sized listed  \n"
  552.                     " are NOT RAM requirements - RAM requirements\n"
  553.                     " are about three times higher.              \n"
  554.                 ))
  555.  
  556.                 (choices
  557.  
  558.                     "  none                        "
  559.                     "  Basis             (  205 KB)"
  560.                     "+ Extensions small  (+ 149 KB)"
  561.                     "+ Extensions medium (+ 549 KB)"
  562.                     "+ Extensions large  (+ 722 KB)"
  563.                 )
  564.  
  565.                 (default 2)
  566.             ))
  567.  
  568.             (complete 75)
  569.  
  570.             (if (<> partsA 0) (
  571.  
  572.                 (working "\nCreating dictionary, sorting entries. May take some minutes.\n")
  573.  
  574.                 (delete "dictionary/english/words/all.words.cnt")
  575.                 (delete "dictionary/english/words/all.words.stat")
  576.  
  577.                 (set cmd "bin/joinsorted >con://///AUTO DIR=dictionary/english/words as=dictionary/english/words/all.words ")
  578.  
  579.                 (if (> partsA 0) (set cmd (cat cmd "english.0 american.0 british.0 ")))
  580.                 (if (> partsA 1) (set cmd (cat cmd "english.1 american.1 british.1 ")))
  581.                 (if (> partsA 2) (set cmd (cat cmd "english.2 american.2 british.2 ")))
  582.                 (if (> partsA 3) (set cmd (cat cmd "english.3 ")))
  583.  
  584.                 (run cmd)
  585.  
  586.                 (complete 80)
  587.  
  588.                 (if (exists "dictionary/english/words/all.words" (noreq))
  589.  
  590.                     (
  591.                         (if (exists "ispell:lib/english.hash")
  592.  
  593.                             (set remove (askbool
  594.  
  595.                                 (prompt "\nOverwrite old hash file (ispell:lib/english.hash) ?")
  596.  
  597.                                 (help "You might want to backup your old file :-)")
  598.  
  599.                                 (choices
  600.  
  601.                                     "overwrite"
  602.                                     "exit"
  603.                                 )
  604.                             ))
  605.  
  606.                             (set remove 1);
  607.                         )
  608.  
  609.                         (if (= remove 1)
  610.  
  611.                             (
  612.                                 (delete "ispell:lib/english.hash")
  613.  
  614.                                 (working "\nCreating hash file supporting fast data access. May take some minutes.\n")
  615.  
  616.                                 (complete 85)
  617.  
  618.                                 (run "ispell:bin/buildhash >NIL: -s dictionary/english/words/all.words dictionary/english/words/english.aff ispell:lib/english.hash")
  619.  
  620.                                 (complete 90)
  621.  
  622.                                 (if (exists "ispell:lib/english.hash")
  623.  
  624.                                     (
  625.                                         (copyfiles
  626.  
  627.                                             (source "dictionary/english/words/english.aff")
  628.                                             (dest "ispell:lib")
  629.                                             (nogauge)
  630.                                         )
  631.  
  632.                                         (message (cat "\nHash file 'ispell:lib/english.hash' has been created successfully. Hash file size (ISpell RAM usage):\n\n" (getsize "ispell:lib/english.hash") " Bytes"))
  633.                                     )
  634.  
  635.                                     (
  636.                                         (message "\nFatal error: hash file creation failed (out of RAM ?).\n")
  637.  
  638.                                         (delete "dictionary/english/words/all.words")
  639.  
  640.                                         (exit (quiet))
  641.                                     )
  642.                                 )
  643.                             )
  644.                         )
  645.  
  646.                         (complete 95)
  647.  
  648.                         (delete "dictionary/english/words/all.words")
  649.                     )
  650.  
  651.                     (
  652.                         (message "\nFatal error - dictionary creation failed.")
  653.  
  654.                         (exit (quiet))
  655.                     )
  656.                 )
  657.             ))
  658.         ))
  659.  
  660.         ; update registry
  661.  
  662.         (if (in action 0)
  663.  
  664.             (
  665.  
  666.                 (working "Updating registry...")
  667.  
  668.                 (run "golded:tools/regedit/regedit script=install.bat")
  669.             )
  670.         )
  671.  
  672.         (complete 100)
  673.     )
  674.  
  675.     (message (cat "\n"
  676.  
  677.         " Please install GoldED before attempting to\n"
  678.         " install this package.                     \n"
  679.     ))
  680. )
  681.  
  682. (exit (quiet))
  683.